<<<<<<< HEAD
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="no-cache" http-equiv="Cache-Control">
    <title>源之东方</title>
    <link href="__STATIC__/css/shopin.css" rel="stylesheet"/>
    <link href="__STATIC__/css/swiper.css" rel="stylesheet"/>
</head>
<body>

<div class="m-detail">
    <div class="slide-banner">
        <div class="swiper-wrapper">
            {volist name="product_banner" id="vo"}
            <div class="swiper-slide"><img src="http://img.58bjcf.com/{$vo.url}"></div>
            {/volist}
        </div>
        <div class="swiper-pagination"></div>
        <a href="javascript:;" class="a-back"></a>
        <a href="javascript:;" class="a-cart"></a>
    </div><!-- //焦点图结束 -->

    <div class="d">
        <h3 class="d-title clamp">{$product_info.product.name}{$product_info.product.summary}</h3>
        <div class="d-main flex">
            <p class="price cell">
                <span class="s"></span>￥{$product_info.price}(市场价)</span>
                <span class="na">￥{$product_info.member_price}(会员价)</span>
            <div>销量：{$product_info.sales_me}</div>
            </p>
            <!--<p class="discount"><b>3折</b></p>-->
        </div>
    </div>

    <div class="m-action">
        <div class="m-only sku"><a href="javascript:skuOpen();" class="btn-link a-sku">请选择需要购买的商品</a></div>
    </div>
    <div class="picDetail mt">
        <!--<div class="btn btn-block view-picture">图片详情</div>-->
        <div class="pic-text">
            <div class="m-text product-text mt">
                <ul>
                    {volist name="product_property" id="vo"}
                    <li>
                        <s>{$vo.name}：</s>
                        <b>{$vo.detail}</b>
                    </li>
                    {/volist}
                </ul>
            </div>
            <!-- 商品信息 -->
            <div class="pic-container mt">
                {volist name="product_img" id="vo"}
                <img src="{$vo.img.url}" style="margin: 0">
                {/volist}
            </div>
        </div>
    </div>
</div>

<div class="buy-bar buy-fixed flex">
    <a class="add-cart cell" href="javascript:skuOpen();">立即购买</a>
    <a class="buy-now cell" href="javascript:addCart();" data-id="{$vo.product.id}">加入购物车</a>
    <a class="go-cart" href="/cart/0"><span>购物车</span><i class="icon">{if condition="isset($product_count)"}
        {$product_count} {else /} 0 {/if}</i></a>
</div>

<div class="m-sku">
    <div class="sku-mask"></div>
    <div class="sku-panel">
        <div class="sku-top"><span class="sku-close">X</span></div>
        <div class="sku-content" id="color_size">
            <div class="row-title">颜色/类型</div>
            <div class="sku-row" id="j_color">
                {volist name="product_all" id="vo"}
                {if condition="$vo.is_home eq 1"}
                <a class="sku-item on" href="javascript:;" data-product="{$vo.product_id}" data-color="{$vo.color}"
                   data-load="0">{$vo.color}</a>
                {else /}
                <a class="sku-item" href="javascript:;" data-product="{$vo.product_id}" data-color="{$vo.color}"
                   data-load="0">{$vo.color}</a>
                {/if}
                {/volist}

            </div>
            <div class="row-title" id="j_size_div" style="display: none">尺码/大小</div>
            <div class="sku-row" id="j_size" style="display: none">
                <!--<a class="sku-item" href="javascript:;">38(5.5)</a>-->
            </div>
        </div>
        <div class="sku-footer">
            <a class="btn-cancel">￥</a>
            <a href="javascript:addCart();" class="btn-submit">加入购物车</a>
            <a href="javascript:buy();" id="btn-go">立即购买</a>
		</div>
	</div>
</div>

<script src="__STATIC__/js/zepto.min.js"></script>
<script src="__STATIC__/js/base.min.js"></script>
<script src="__STATIC__/js/swiper.js"></script>
<script src="__STATIC__/js/shopin.js"></script>
<script type="text/javascript" src="http://www.jq22.com/demo/copy20161120/dist/clipboard.min.js"></script>
<script>
    //焦点图
    var mySwiper = new Swiper('.slide-banner', {
        pagination: '.swiper-pagination',
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });

    //选择颜色、尺码
    // $('.m-sku .sku-row .sku-item').live('tap', function () {
    //     if ($(this).hasClass('on')) {
    //         $(this).removeClass('on');
    //     } else {
    //         $(this).addClass('on').siblings().removeClass('on');
    //     };
    //     skuSubmit();
    // });

    //open SKU
    function skuOpen() {
        $('.sku-panel').addClass('sku-move');
        $('.sku-mask, .sku-panel').css('display', 'block');
    };

    //获取选定的颜色和尺码
    function skuSubmit() {
        var colorValue = $("#j_color").find(".on").text();
        var sizeValue = $("#j_size").find(".on").text();
        if (colorValue != null && sizeValue == null) {
            $(".a-sku").text('颜色：' + colorValue + '　选择尺码');
        }
        if (colorValue == null && sizeValue != null) {
            $(".a-sku").text('尺码：' + sizeValue + '　选择颜色');
        }
        if (colorValue == null && sizeValue == null) {
            $(".a-sku").text("请选择颜色尺码");
        }
        if (colorValue != null && sizeValue != null) {
            $(".a-sku").text(colorValue + ' ' + sizeValue);
        }
    };

    //close SKU
    $('.sku-mask, .sku-close').on('tap', function () {
        $('.sku-panel').addClass('sku-back');
        setTimeout("skuClose()", 300)
    });

    function skuClose() {
        $('.sku-panel').removeClass('sku-back')
        $('.sku-panel, .sku-mask').css('display', 'none');
    };
</script>
<script src="__STATIC__/js/jquery-3.1.1.min.js"></script>
<script>
    function g(rom) {

        pries = $(rom).attr("data-price");
//  	console.log(pries)
        $('.btn-cancel').html('￥' + pries);
    }

    //会员价
    function vip(obj) {
        vip_price = $(obj).attr("data-member_price");
        $('.btn-cancel').html('￥' + vip_price);
    }
</script>
<script>
    $.noConflict();
    jQuery('#j_color a').click(function () {
        var is_click = jQuery(this).attr('data-load');
        if (is_click == 1) {
            jQuery('#j_size a').css('display', 'none');
            var color = jQuery(this).attr('data-color');
            var product = jQuery(this).attr('data-product');
            jQuery('#j_size a[data-product="' + product + '"][data-color="' + color + '"]').css('display', 'inline-block');
            jQuery(this).addClass('on');
            return true;
        }
        jQuery('#j_color a').find('.on').removeClass('on');
        jQuery(this).addClass('on');
        var that = jQuery(this);
        var color = jQuery(this).attr('data-color');
        var product = jQuery(this).attr('data-product');
        jQuery.ajax({
            type: 'post',
            dataType: 'json',
            data: {
                product_id: product,
                color: color
            },
            url: "/product_size",
            async: true,
            success: function (data) {
                var rows = data.data;
                console.log(rows);
                if (data.status == 0) {
                }
                if (data.status == 1) {
                    that.attr('data-load', 1);
                    jQuery('#j_size a').css('display', 'none');
                    var le = rows.length;
                    if (le > 0) {
                        for (var i = 0; i < le; i++) {

                            if (rows[i]['isvip'] == 1) {
                                var a = '<a class="sku-item" href="javascript:;" style="display: inline-block;" data-id="' + rows[i].id + '"  data-product="' + rows[i].product_id + '" data-color="' + rows[i].color + '" data-price="' + rows[i].price + '"" data-member_price="' + rows[i].member_price + '" onclick="vip(this)">' + rows[i].size + '</a>';
                            } else {
                                var a = '<a class="sku-item" href="javascript:;" style="display: inline-block;" data-id="' + rows[i].id + '"  data-product="' + rows[i].product_id + '" data-color="' + rows[i].color + '" data-price="' + rows[i].price + '"" data-member_price="' + rows[i].member_price + '" onclick="g(this)">' + rows[i].size + '</a>';
                            }
                            jQuery('#j_size').append(a);

                             $('#j_size a:first-of-type').click();
                        }
                    } else {
                        jQuery('#j_size_div').css('display', 'none');
                    }
                    jQuery('#j_size_div').css('display', 'block');
                    jQuery('#j_size').css('display', 'block');

                }
            },
            error: function (e) {
                console.log(e);
            }
        });
    });
    var color = "{$home.color}";
    $('#j_color a[data-color="' + color + '"]').click();
    $(document).on('click', '#j_size .sku-item', function () {
        if (!$(this).hasClass('on')) {
            $(this).removeClass('on');
        } else {
            $(this).addClass('on').siblings().removeClass('on');
        };

    });
    $(document).on('click', '#j_color .sku-item', function () {
        if (!$(this).hasClass('on')) {
            $(this).removeClass('on');
        } else {
            $(this).addClass('on').siblings().removeClass('on');
        };

    });
</script>
<script>
    function addCart() {
        if (jQuery('.sku-panel').hasClass('sku-move')) {
            var colorValue = jQuery("#j_color").find(".on").text();
            var sizeValue = jQuery("#j_size").find(".on").text();
            if (!colorValue || !sizeValue) {
                alert('请选择您要选择的商品类型');
                skuOpen();
                return false;
            }
            if (colorValue && sizeValue) {
                var getCartNum = parseInt(jQuery('.go-cart .icon').text());
                skuClose();
                var primary = jQuery("#j_size").find(".on").attr('data-id');
                jQuery.ajax({
                    type: 'post',
                    dataType: 'json',
                    data: {
                        pid: primary,
                        num: 1,
                        gid: $('.buy-now').attr('data-id'),
                    },
                    url: "/addcart",
                    async: true,
                    success: function (data) {
                        var i = JSON.parse(data);
                        if(i.code == 200) {
                            var setCartNum = getCartNum + 1; // 数量加 1
                            $('.go-cart .icon').text(setCartNum);
                            alert(i.info);
                        } else {
                            alert(i.info);
                        }
                    },
                    error: function (e) {
                        //异常处理；
                        var error = e.responseJSON.msg;
                        var arr = Object.values(error);
                        alert(arr);
                    }
                });
            }
        } else {
            skuOpen();
        }
    }

    function skuOpen() {
        $('.sku-panel').addClass('sku-move');
        $('.sku-mask, .sku-panel').css('display', 'block');
    }
    function buy() {
        var colorValue = $("#j_color").find(".on").text();
        var sizeValue = $("#j_size").find(".on").text();
        var primary = $("#j_size").find(".on").attr('data-id');

        var price = $('.btn-cancel').text();
        if(!colorValue || !sizeValue){
            alert('请选择购买的商品类型');
            return false;
        }

        if (primary) {
            location.href = '/buy/' + primary;
            return true;
        }
    }
</script>
</body>
</html>
=======
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">
    <meta content="no-cache" http-equiv="Cache-Control">
    <title>源之东方</title>
    <link href="__STATIC__/css/shopin.css" rel="stylesheet"/>
    <link href="__STATIC__/css/swiper.css" rel="stylesheet"/>
</head>
<body>

<div class="m-detail">
    <div class="slide-banner">
        <div class="swiper-wrapper">
            {volist name="product_banner" id="vo"}
            <div class="swiper-slide"><img src="http://img.58bjcf.com/{$vo.url}"></div>
            {/volist}
        </div>
        <div class="swiper-pagination"></div>
        <a href="javascript:;" class="a-back"></a>
        <a href="javascript:;" class="a-cart"></a>
    </div><!-- //焦点图结束 -->

    <div class="d">
        <h3 class="d-title clamp">{$product_info.product.name}{$product_info.product.summary}</h3>
        <div class="d-main flex">
            <p class="price cell">
                <span class="s"></span>￥{$product_info.price}(市场价)</span>
                <span class="na">￥{$product_info.member_price}(会员价)</span>
            <div>销量：{$product_info.sales_me}</div>
            </p>
            <!--<p class="discount"><b>3折</b></p>-->
        </div>
    </div>

    <div class="m-action">
        <div class="m-only sku"><a href="javascript:skuOpen();" class="btn-link a-sku">请选择需要购买的商品</a></div>
    </div>
    <div class="picDetail mt">
        <!--<div class="btn btn-block view-picture">图片详情</div>-->
        <div class="pic-text">
            <div class="m-text product-text mt">
                <ul>
                    {volist name="product_property" id="vo"}
                    <li>
                        <s>{$vo.name}：</s>
                        <b>{$vo.detail}</b>
                    </li>
                    {/volist}
                </ul>
            </div>
            <!-- 商品信息 -->
            <div class="pic-container mt">
                {volist name="product_img" id="vo"}
                <img src="{$vo.img.url}" style="margin: 0">
                {/volist}
            </div>
        </div>
    </div>
</div>

<div class="buy-bar buy-fixed flex">
    <a class="add-cart cell" href="javascript:skuOpen();">立即购买</a>
    <a class="buy-now cell" href="javascript:addCart();" data-id="{$vo.product.id}">加入购物车</a>
    <a class="go-cart" href="/cart/0"><span>购物车</span><i class="icon">{if condition="isset($product_count)"}
        {$product_count} {else /} 0 {/if}</i></a>
</div>

<div class="m-sku">
    <div class="sku-mask"></div>
    <div class="sku-panel">
        <div class="sku-top"><span class="sku-close">X</span></div>
        <div class="sku-content" id="color_size">
            <div class="row-title">颜色/类型</div>
            <div class="sku-row" id="j_color">
                {volist name="product_all" id="vo"}
                {if condition="$vo.is_home eq 1"}
                <a class="sku-item on" href="javascript:;" data-product="{$vo.product_id}" data-color="{$vo.color}"
                   data-load="0">{$vo.color}</a>
                {else /}
                <a class="sku-item" href="javascript:;" data-product="{$vo.product_id}" data-color="{$vo.color}"
                   data-load="0">{$vo.color}</a>
                {/if}
                {/volist}

            </div>
            <div class="row-title" id="j_size_div" style="display: none">尺码/大小</div>
            <div class="sku-row" id="j_size" style="display: none">
                <!--<a class="sku-item" href="javascript:;">38(5.5)</a>-->
            </div>
        </div>
        <div class="sku-footer">
            <a class="btn-cancel">￥</a>
            <a href="javascript:addCart();" class="btn-submit">加入购物车</a>
            <a href="javascript:buy();" id="btn-go">立即购买</a>
		</div>
	</div>
</div>

<script src="__STATIC__/js/zepto.min.js"></script>
<script src="__STATIC__/js/base.min.js"></script>
<script src="__STATIC__/js/swiper.js"></script>
<script src="__STATIC__/js/shopin.js"></script>
<script type="text/javascript" src="http://www.jq22.com/demo/copy20161120/dist/clipboard.min.js"></script>
<script>
    //焦点图
    var mySwiper = new Swiper('.slide-banner', {
        pagination: '.swiper-pagination',
        autoplay: 3000,
        autoplayDisableOnInteraction: false
    });

    //选择颜色、尺码
    // $('.m-sku .sku-row .sku-item').live('tap', function () {
    //     if ($(this).hasClass('on')) {
    //         $(this).removeClass('on');
    //     } else {
    //         $(this).addClass('on').siblings().removeClass('on');
    //     };
    //     skuSubmit();
    // });

    //open SKU
    function skuOpen() {
        $('.sku-panel').addClass('sku-move');
        $('.sku-mask, .sku-panel').css('display', 'block');
    };

    //获取选定的颜色和尺码
    function skuSubmit() {
        var colorValue = $("#j_color").find(".on").text();
        var sizeValue = $("#j_size").find(".on").text();
        if (colorValue != null && sizeValue == null) {
            $(".a-sku").text('颜色：' + colorValue + '　选择尺码');
        }
        if (colorValue == null && sizeValue != null) {
            $(".a-sku").text('尺码：' + sizeValue + '　选择颜色');
        }
        if (colorValue == null && sizeValue == null) {
            $(".a-sku").text("请选择颜色尺码");
        }
        if (colorValue != null && sizeValue != null) {
            $(".a-sku").text(colorValue + ' ' + sizeValue);
        }
    };

    //close SKU
    $('.sku-mask, .sku-close').on('tap', function () {
        $('.sku-panel').addClass('sku-back');
        setTimeout("skuClose()", 300)
    });

    function skuClose() {
        $('.sku-panel').removeClass('sku-back')
        $('.sku-panel, .sku-mask').css('display', 'none');
    };
</script>
<script src="__STATIC__/js/jquery-3.1.1.min.js"></script>
<script>
    function g(rom) {

        pries = $(rom).attr("data-price");
//  	console.log(pries)
        $('.btn-cancel').html('￥' + pries);
    }

    //会员价
    function vip(obj) {
        vip_price = $(obj).attr("data-member_price");
        $('.btn-cancel').html('￥' + vip_price);
    }
</script>
<script>
    $.noConflict();
    jQuery('#j_color a').click(function () {
        var is_click = jQuery(this).attr('data-load');
        if (is_click == 1) {
            jQuery('#j_size a').css('display', 'none');
            var color = jQuery(this).attr('data-color');
            var product = jQuery(this).attr('data-product');
            jQuery('#j_size a[data-product="' + product + '"][data-color="' + color + '"]').css('display', 'inline-block');
            jQuery(this).addClass('on');
            return true;
        }
        jQuery('#j_color a').find('.on').removeClass('on');
        jQuery(this).addClass('on');
        var that = jQuery(this);
        var color = jQuery(this).attr('data-color');
        var product = jQuery(this).attr('data-product');
        jQuery.ajax({
            type: 'post',
            dataType: 'json',
            data: {
                product_id: product,
                color: color
            },
            url: "/product_size",
            async: true,
            success: function (data) {
                var rows = data.data;
                console.log(rows);
                if (data.status == 0) {
                }
                if (data.status == 1) {
                    that.attr('data-load', 1);
                    jQuery('#j_size a').css('display', 'none');
                    var le = rows.length;
                    if (le > 0) {
                        for (var i = 0; i < le; i++) {

                            if (rows[i]['isvip'] == 1) {
                                var a = '<a class="sku-item" href="javascript:;" style="display: inline-block;" data-id="' + rows[i].id + '"  data-product="' + rows[i].product_id + '" data-color="' + rows[i].color + '" data-price="' + rows[i].price + '"" data-member_price="' + rows[i].member_price + '" onclick="vip(this)">' + rows[i].size + '</a>';
                            } else {
                                var a = '<a class="sku-item" href="javascript:;" style="display: inline-block;" data-id="' + rows[i].id + '"  data-product="' + rows[i].product_id + '" data-color="' + rows[i].color + '" data-price="' + rows[i].price + '"" data-member_price="' + rows[i].member_price + '" onclick="g(this)">' + rows[i].size + '</a>';
                            }
                            jQuery('#j_size').append(a);

                             $('#j_size a:first-of-type').click();
                        }
                    } else {
                        jQuery('#j_size_div').css('display', 'none');
                    }
                    jQuery('#j_size_div').css('display', 'block');
                    jQuery('#j_size').css('display', 'block');

                }
            },
            error: function (e) {
                console.log(e);
            }
        });
    });
    var color = "{$home.color}";
    $('#j_color a[data-color="' + color + '"]').click();
    $(document).on('click', '#j_size .sku-item', function () {
        if (!$(this).hasClass('on')) {
            $(this).removeClass('on');
        } else {
            $(this).addClass('on').siblings().removeClass('on');
        };

    });
    $(document).on('click', '#j_color .sku-item', function () {
        if (!$(this).hasClass('on')) {
            $(this).removeClass('on');
        } else {
            $(this).addClass('on').siblings().removeClass('on');
        };

    });
</script>
<script>
    function addCart() {
        if (jQuery('.sku-panel').hasClass('sku-move')) {
            var colorValue = jQuery("#j_color").find(".on").text();
            var sizeValue = jQuery("#j_size").find(".on").text();
            if (!colorValue || !sizeValue) {
                alert('请选择您要选择的商品类型');
                skuOpen();
                return false;
            }
            if (colorValue && sizeValue) {
                var getCartNum = parseInt(jQuery('.go-cart .icon').text());
                skuClose();
                var primary = jQuery("#j_size").find(".on").attr('data-id');
                jQuery.ajax({
                    type: 'post',
                    dataType: 'json',
                    data: {
                        pid: primary,
                        num: 1,
                        gid: $('.buy-now').attr('data-id'),
                    },
                    url: "/addcart",
                    async: true,
                    success: function (data) {
                        var i = JSON.parse(data);
                        if(i.code == 200) {
                            var setCartNum = getCartNum + 1; // 数量加 1
                            $('.go-cart .icon').text(setCartNum);
                            alert(i.info);
                        } else {
                            alert(i.info);
                        }
                    },
                    error: function (e) {
                        //异常处理；
                        var error = e.responseJSON.msg;
                        var arr = Object.values(error);
                        alert(arr);
                    }
                });
            }
        } else {
            skuOpen();
        }
    }

    function skuOpen() {
        $('.sku-panel').addClass('sku-move');
        $('.sku-mask, .sku-panel').css('display', 'block');
    }
    function buy() {
        var colorValue = $("#j_color").find(".on").text();
        var sizeValue = $("#j_size").find(".on").text();
        var primary = $("#j_size").find(".on").attr('data-id');

        var price = $('.btn-cancel').text();
        if(!colorValue || !sizeValue){
            alert('请选择购买的商品类型');
            return false;
        }

        if (primary) {
            location.href = '/buy/' + primary;
            return true;
        }
    }
</script>
</body>
</html>
>>>>>>> 93c40d8086b7a8d5a9aa3548fdc8eb06a4272cf7
